package com.bwie.auth.remote;

import com.bwie.auth.remote.factory.SysUserRemoteFactoryService;
import com.bwie.common.doamin.dto.LoginDTO;
import com.bwie.common.doamin.dto.RegisterDTO;
import com.bwie.common.doamin.model.SysUser;
import com.bwie.common.doamin.vo.LoginVO;
import com.bwie.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;

/**
 * @className: SysUserRemoteService
 * @Description: TODO
 * @version: v1.８.0
 * @author: 刘洋朔
 * @date: 2025/9/9 10:54
 */
@FeignClient(value = "bwie-system",fallbackFactory = SysUserRemoteFactoryService.class)
public interface SysUserRemoteService {
    /**
     * 获取登录的用户信息
     * @param loginDTO
     * @return
     */
    @PostMapping("system/selLoginInfo")
    public Result<SysUser> selLoginInfo(@RequestBody LoginDTO loginDTO);

    /**
     * 用户注册
     * @param registerDTO
     * @return void
     */
    @PostMapping("system/register")
    public Result<Void> register(@RequestBody @Valid RegisterDTO registerDTO);

    /**
     * 获取登录的角色id
     * @param userId
     * @return
     */
    @GetMapping("system/selRoleByUserId/{userId}")
    public Result<Long> selRoleByUserId(@PathVariable("userId") Long userId);
}
